package cn.afterturn.easypoi.word.entity.bookmark;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import javax.persistence.*;
import java.util.HashSet;
import java.util.Set;
/*@Data
@ToString(callSuper = true)
@EqualsAndHashCode()*/
@Entity
@Table(name = "paragraphEntityVO", schema = "jeecg-boot-sjk", catalog = "")
public class ParagraphEntityVO {
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getBookMarkFromHFPC() {
        return bookMarkFromHFPC;
    }

    public void setBookMarkFromHFPC(String bookMarkFromHFPC) {
        this.bookMarkFromHFPC = bookMarkFromHFPC;
    }

    public int getParaSequence() {
        return paraSequence;
    }

    public void setParaSequence(int paraSequence) {
        this.paraSequence = paraSequence;
    }

    public String getParaText() {
        return paraText;
    }

    public void setParaText(String paraText) {
        this.paraText = paraText;
    }

    public int getMaxbookvalueCount() {
        return maxbookvalueCount;
    }

    public void setMaxbookvalueCount(int maxbookvalueCount) {
        this.maxbookvalueCount = maxbookvalueCount;
    }

    public String getHighlightColor() {
        return highlightColor;
    }

    public void setHighlightColor(String highlightColor) {
        this.highlightColor = highlightColor;
    }

    public Set<BookMarkEntityVO> getBookMarkEntityVOS() {
        return bookMarkEntityVOS;
    }

    public void setBookMarkEntityVOS(Set<BookMarkEntityVO> bookMarkEntityVOS) {
        this.bookMarkEntityVOS = bookMarkEntityVOS;
    }

    public HeaderEntityVO getHeaderEntityVO() {
        return headerEntityVO;
    }

    public void setHeaderEntityVO(HeaderEntityVO headerEntityVO) {
        this.headerEntityVO = headerEntityVO;
    }

    public WordEntityVO getWordEntityVO() {
        return wordEntityVO;
    }

    public void setWordEntityVO(WordEntityVO wordEntityVO) {
        this.wordEntityVO = wordEntityVO;
    }

    public CellEntityVO getCellEntityVO() {
        return cellEntityVO;
    }

    public void setCellEntityVO(CellEntityVO cellEntityVO) {
        this.cellEntityVO = cellEntityVO;
    }

    public FootEntityVO getFootEntityVO() {
        return footEntityVO;
    }

    public void setFootEntityVO(FootEntityVO footEntityVO) {
        this.footEntityVO = footEntityVO;
    }

    @Id

    @Column(name = "id")
    private String id;
    private String bookMarkFromHFPC;
    private int paraSequence;
    private String paraText;
    @JsonIgnore
    @Transient
    private int maxbookvalueCount;//暂时未用
    @JsonIgnore
    @Transient
    private String highlightColor;//暂时未用
    @JsonIgnoreProperties("paragraphEntityVO")
    @OneToMany(mappedBy = "paragraphEntityVO",cascade = CascadeType.ALL,fetch = FetchType.EAGER)
    private Set<BookMarkEntityVO> bookMarkEntityVOS=new HashSet<>();

    @JsonIgnore
    @JsonIgnoreProperties("paragraphEntityVOS")
    @ManyToOne(cascade = CascadeType.ALL,optional = false,fetch = FetchType.LAZY)
    @JoinColumn(name = "hfid"/*,foreignKey = @ForeignKey(name = "none",value = ConstraintMode.NO_CONSTRAINT)*/)
    private HeaderEntityVO headerEntityVO;

    @JsonIgnore
    @JsonIgnoreProperties("paragraphEntityVOS")
    @ManyToOne(cascade = CascadeType.ALL,optional = false,fetch = FetchType.LAZY)
    @JoinColumn(name = "pfid"/*,foreignKey = @ForeignKey(name = "none",value = ConstraintMode.NO_CONSTRAINT)*/)
    private WordEntityVO wordEntityVO;
    @JsonIgnore
    @JsonIgnoreProperties("paragraphEntityVOS")
    @ManyToOne(cascade = CascadeType.ALL,optional = false,fetch = FetchType.LAZY)
    @JoinColumn(name = "cfid"/*,foreignKey = @ForeignKey(name = "none",value = ConstraintMode.NO_CONSTRAINT)*/)
    private CellEntityVO cellEntityVO;
    @JsonIgnore
    @JsonIgnoreProperties("paragraphEntityVOS")
    @ManyToOne(cascade = CascadeType.ALL,optional = false,fetch = FetchType.LAZY)
    @JoinColumn(name = "ffid"/*,foreignKey = @ForeignKey(name = "none",value = ConstraintMode.NO_CONSTRAINT)*/)
    private FootEntityVO footEntityVO;
}
//manytoOne 中把循环关系去掉
//manytoone，本身序列化到文件中，把它去掉。感觉2个可以同时使用